﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MolyMade.Moly.MailMessager.SmtpClient;

namespace MolyMade.Moly.Tester
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            BaseSmtp stmp = new BaseSmtp("smtp.163.com",25,textBox3.Text,textBox2.Text)
            {
                EnableSsl = true,
            };
            BaseMessage message = new BaseMessage()
            {
                MailAddress = "molymade@163.com",
                SourceId = "molySource",
                DestId = "molyDest",
                Subject = DateTime.Now.ToLongTimeString(),
                Body = DateTime.Now.Ticks.ToString(),
            };
            stmp.Connect();
            stmp.Send(message);
            textBox1.Text = message.Subject;
        }
    }
}
